package com.zxblog.controller;

import com.zxblog.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @RequestMapping("/publishArticle")
    @ResponseBody
    public String publishArticle(
            @RequestParam(required = true) String articleContentText
            ){

        return "OK,id is:"+articleService.publishArticle(10001, articleContentText, 1);
    }

}
